#ifndef PARTICLEMANAGER_H
#define PARTICLEMANAGER_H

#include "vector"

#include "ngl/Transformation.h"
#include "ngl/TransformStack.h"

#include "Particle.h"
#include "ShaderManager.h"

class ParticleManager
{
public:
    ParticleManager
            (
                const float _height,
                const float _width,
                const float _verticalCount,
                const float _horizontalCount,
                const float _mass,
                const float _radius
            );

    void evaluateEularExplicit();

    void evaluateRK2();

    void evaluateRK4();

    void evaluateVerlet();

    /// @brief creates vbo for drawing
    void loadGeometry();

    /// @brief draws the particles
    /// @param[in] _txStack the transform stack, used for pushing and popping opengl states
    /// @param[in,out] io_sman the shader manager, used for shading/rendering of the objects
    /// @param[in] _shader the shader used for drawing
    void draw
            (
                ngl::TransformStack _txStack,
                ShaderManager* io_sman,
                const std::string _shader
            );


private:
    std::vector<Particle*>* m_particleList;

private:
    void evaluateNetForces();
};

#endif // PARTICLEMANAGER_H
